#ifndef COMMON_H
#define COMMON_H

#include <QString>
#include <vector>

enum SolverType
{
  TEST_SOLVER = 0,
  EXPLICIT_EULER = 1,
  IMPLICIT_EULER = 2,
  RUNGE_KUTTA = 3,

  MAX_TYPE = 4,
};

SolverType& operator ++ (SolverType& type);


const QString solversNames[MAX_TYPE] = {"Test solver","Explicit Euler method","Implicit Euler method","Runge-Kutta method"};

struct SolutionParameters
{
public:
  SolutionParameters(SolverType _type = EXPLICIT_EULER, double _tStart = 0.0, double _tEnd = 100.0, double _tDelta = 1.0) 
    : type(_type)
    , tStart(_tStart)
    , tEnd(_tEnd)
    , tDelta(_tDelta)
  {}
public:
  SolverType type;
  double tStart, tEnd, tDelta;

};

template <typename T>
class IdxPair : public std::pair<T, int>
{
public:
  IdxPair(T val, int idx) : std::pair<T, int>(val, idx) {}
  bool operator < (const IdxPair& p) { return first < p.first; }
};

#endif // COMMON_H
